<?php
namespace Admin\Controller;
use Think\Controller;
class CommonController extends Controller{
    public function _initialize(){
        // tp构造方法
        $this->CheckLogin();
    }

    public function CheckLogin(){
        $Admin_Id = session('Admin_Id');
        $allow_Controller = array('Login'); // 允许不登陆的控制器
        $Controller_name = CONTROLLER_NAME;
        if(!in_array($Controller_name,$allow_Controller)){
            if(!isset($Admin_Id)){
                header("Location:" . U('Login/index'));
                exit;
            }
        }
    }


}